<%-- 
    Document   : proveedor_registrar
    Created on : 21/04/2011, 11:29:39 PM
    Author     : ERVIRI
--%>
<%@page contentType="text/html" pageEncoding="UTF-8" language="java" import ="java.util.*" import ="java.text.DecimalFormat" import="java.sql.*" errorPage="ErrorPage.jsp" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
<jsp:useBean id="model"	scope="session" class="mvc.model.WebModel"/>
<%@page import="mvc.controller.ControllerServlet"  %>

<%
System.out.println("----//INITMODEL----llegada----");
model.init(application); %>

<%

    request= (HttpServletRequest)pageContext.getRequest();
    String BASEURL= request.getContextPath();//Permite ir a la ruta inicial del proyecto.
    String CONTROLLER=BASEURL + "/controller";
   //exception.printStackTrace();
 %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf8" />
<title>UBICACION DE ABASTOS FERRETERIA BARATONGO</title>

<link href="<%=request.getContextPath()%>/view.css"   rel="stylesheet" type="text/css" media="all">
<link href="<%=request.getContextPath()%>/stylesheet.css" rel="stylesheet" type="text/css" media="all" />
<link href="<%=request.getContextPath()%>/menudos.css" rel="stylesheet" type="text/css" media="all" />

<style type="text/css">
 p.MsoNormal
	{margin-top:0cm;
	margin-right:0cm;
	margin-bottom:10.0pt;
	margin-left:0cm;
	line-height:115%;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";
	}
</style>
<script language="javascript" type="text/javascript">

    function validacion(formulario) {

	var er_codigo = /^([0-9\s\+\-])+$/	
	var er_nombre = /^([a-z]|[A-Z]|á|é|í|ó|ú|ñ|ü|\s|\.|-)+$/
        var er_apellidos = /^([a-z]|[A-Z]|á|é|í|ó|ú|ñ|ü|\s|\.|-)+$/
        var er_telefono = /^([0-9\s\+\-])+$/
        var er_direccion = /^([a-z]|[A-Z]|á|é|í|ó|ú|ñ|ü|\s|\.|-)+$/
        var er_email = /^(.+\@.+\..+)$/
	var x

	//comprueba 50 caracteres maximo
	for(x = 1; x < 5; x++) {
		if (formulario.elements[x].value.length > 50) {
			alert('La lontitud máxima permitida para cualquier campo es de 10 caracteres.')
			return false
		}
	}

	//comprueba campo del codigo
	if(!er_codigo.test(formulario.codigo.value)) {
		alert('CONTENIDO DEL CAMPO CODIGO INVALIDO')
		return false
	}
        //comprueba campo de nombre
	if(!er_nombre.test(formulario.nombre.value)) {
		alert('CONTENIDO DEL CAMPO NOMBRE ES INVALIDO')
		return false
	}
        if(!er_apellidos.test(formulario.apellidos.value)) {
		alert('CONTENIDO DEL CAMPO APELLIDOS ES INVALIDO')
		return false
	}

	//comprueba campos de valor
	if( !er_telefono.test(formulario.telefono.value) ) {
		alert('CONTENIDO DEL CAMPO TELEFONO ES INVALIDO')
		return false
	}

	//comprueba campo de descripcion
	if(!er_email.test(formulario.email.value)) {
		alert('CONTENIDO DEL CAMPO EMAIL ES INVALIDO')
		return false
	}
}

</script>
</head>

    <body><img id="top" src="<%=BASEURL%>/top.png" alt=""></img>

<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td align="center" valign="top"><table width="760" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td align="left" valign="top">
		<table border="0" cellspacing="0" cellpadding="0" style="height: 255px; width: 825px;">
          <tr>
            <td width="200" align="left" valign="top" bgcolor="#424242">
			<table width="200" border="0" cellspacing="0" cellpadding="0" style="height: 227px">
              <tr>
                <td align="center" valign="middle" class="logo_bg" style="width: 200px">
				<img src="mvc.Logos/proveedor 40x40.png" width="67" height="65" /></td>
              </tr>
              <tr>
                <td align="left" valign="top" style="width: 200px">
				<table width="200" border="0" cellspacing="0" cellpadding="0" style="height: 186px">
                  <tr>
                    <td class="on" onmouseover="this.className='on'"onmouseout="this.className='off'" height="30" align="left" valign="middle" style="height: 30px"><a href="PagInicio.jsp" class="left_menu_text" >
					inicio</a></td>
                  </tr>
                  <tr>
                    <td class="off" onmouseover="this.className='on'" onmouseout="this.className='off'" height="30" align="left" valign="middle"><a href="servicios.jsp" class="left_menu_text">
					Servicios</a></td>
                  </tr>
                  <tr>
                    <td class="off" onmouseover="this.className='on'" onmouseout="this.className='off'" height="30" align="left" valign="middle"><a href="nuestraempresa.jsp" class="left_menu_text">
					Nuestra empresa</a></td>
                  </tr>
                  <tr>
                    <td class="off" onmouseover="this.className='on'" onmouseout="this.className='off'" height="30" align="left" valign="middle"><a href="productos.jsp" class="left_menu_text">
					Productos</a></td>
                  </tr>
                  <tr>
                    <td class="off" onmouseover="this.className='on'" onmouseout="this.className='off'" height="30" align="left" valign="middle"><a href="clientes.jsp" class="left_menu_text">
					Clientes</a></td>
                  </tr>
                  <tr>
                    <td class="off" onmouseover="this.className='on'" onmouseout="this.className='off'" align="left" valign="middle" style="height: 17px"><a href="secciones.jsp" class="left_menu_text">
					Secciones</a></td>
                  </tr>
                </table></td>
              </tr>
            </table></td>
            <td width="560">
			<table border="0" cellspacing="0" cellpadding="0" style="width: 736px; height: 159px;">
              <tr>
                <td align="left" valign="top" class="header_top_image" style="height: 250px; width: 556px;">
				</td>
              </tr>
              <tr>
                  
                  
                  <td>
  <ul id="HDropdown-orange-classic">

<li><a href="#" title="Producto">Producto</a>
<ul>
<li><a href="producto_registrar.jsp">Registrar </a></li>
<li><a href="#">Listar </a></li>
<li><a href="#">Modificar </a></li>
<li><a href="#">eliminar </a></li>
</ul>
</li>
<li><a href="#" title="Usuario">Usuario</a>
<ul>
<li><a href="usuario_registrar.jsp">Registrar </a></li>
<li><a href="#">Listar </a></li>
<li><a href="#">Modificar </a></li>
<li><a href="#">eliminar </a></li>
</ul>
</li>
<li><a href="#" title="Provedor">Proveedor</a>
<ul>
<li><a href="proveedor_registrar.jsp">Registrar </a></li>
<li><a href="#">Listar </a></li>
<li><a href="#">Modificar </a></li>
<li><a href="#">eliminar </a></li>
</ul>
</li>
<li><a href="<%=request.getContextPath()%>/PagInicio.jsp" title="Salir">Salir</a></li>
</ul>





                </td>
              </tr>
            </table></td>
      </tr>
        </table></td>
      </tr>
      <tr>
        <td align="left" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" class="body_table">
          <tr>
            <td class="news_text"   align="left" valign="top" bgcolor="#EFEFEF" style="width: 231px"><table width="200" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td style="padding:11px; border-bottom:2px solid #FFF; " align="center" valign="top">
				<table border="0" cellspacing="0" cellpadding="0" style="width: 182px">
                    <tr>
                      <td align="left"><img src="mvc.images/news.gif" alt="" width="156" height="35" /></td>
                    </tr>
                    <tr>
                      <td  style="padding-top:10px; text-align:justify;" align="left"><strong style="text-decoration:underline;">07.11.2011</strong><br />
                        Nam lacinia risus. Aliquam volutpat aliquam augue. Aliquam nulla ante, Aliquam nulla ante, varius<br />
                        <br />
                        <strong style="text-decoration:underline;">07.11.2011</strong><br />
                        Nam lacinia risus. Aliquam volutpat aliquam augue. Aliquam nulla ante, Aliquam nulla ante, varius<br />
                        <br />
                        <strong style="text-decoration:underline;">07.11.2011</strong><br />
Nam lacinia risus. Aliquam volutpat aliquam augue. Aliquam nulla ante, Aliquam nulla ante, variusNam lacinia risus. Aliquam volutpat aliquam augue. Aliquam nulla ante, Aliquam nulla ante, varius</td>
                    </tr>
                </table></td>
              </tr>
              <tr>
                <td align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td align="left" valign="top">&nbsp;</td>
                  </tr>
                  <tr>
                    <td align="center" valign="top"><img src="mvc.images/map.jpg" alt="" width="112" height="63" /></td>
                  </tr>
                  <tr>
                    <td align="left" valign="top">&nbsp;</td>
                  </tr>
                  <tr>
                    <td align="center" valign="top"><a href="pagInicioubicacion.jsp" class="orange_link">	Ubicacion</a></td>
                  </tr>
                </table></td>
              </tr>
            </table></td>
            <td style="padding:12px;" align="left" valign="top">

            <div id="form_container">

		<h1><a>Registrar Proveedor</a></h1>

               <form onsubmit="return validacion(this)" name="FormValidacion" id="form" class="appnitro"  method="post" action="<%=CONTROLLER%>/Registrar/Proveedor">
               <div class="form_description">
                            <h2>Registrar Proveedor</h2>

                            <p>Registra los Proveeedores en la base de datos.</p>
                </div>
                    <ul >
                    <li id="li_1" >
                        <label class="description" for="element_1">Codigo Proveedor </label>
                        <div>
                             <input id="codigo" name="codigo" class="element text medium" type="text" maxlength="255" value=""/>
                        </div>
                    </li>
                    <li id="li_2" >
                        <label class="description" for="element_2">Nombre Proveedor </label>
                        <div>
                             <input id="nombre" name="nombre" class="element text medium" type="text" maxlength="255" value=""/>
                        </div>
                    </li>
                    <li id="li_3" >
                            <label class="description" for="element_3">Apellidos </label>
                       <div>
                                <input id="apellidos" name="apellidos" class="element text medium" type="text" maxlength="255" value=""/>
                        </div>
                    </li>
                    <li id="li_4" >
                        <label class="description" for="element_4">Telefono  </label>
                        <div>
                            <input id="telefono" name="telefono" class="element text medium" type="text" maxlength="255" value=""/>
                        </div>
                    </li>
                    <li id="li_5" >
                            <label class="description" for="element_5">Direccion </label>
                       <div>
                           <input id="direccion" name="direccion" class="element text medium" type="text" maxlength="255" value=""/>
                        </div>
                    </li>
                    <li id="li_6" >
                        <label class="description" for="element_6">Email  </label>
                        <div>
                            <input id="email" name="email" class="element text medium" type="text" maxlength="255" value=""/>
                        </div>
                    </li>
                    <li class="buttons">

                        <input id="saveForm" class="button_text" type="submit" name="submit" value="Enviar" />
                        <input type="reset"  class="button_text" name="formReset" />
                    </li>
                    </ul>
		</form>

           </div>


          </td>

          </tr>
        </table></td>
      </tr>
      <tr>
        <td align="left" valign="top">
		<table border="0" cellspacing="0" cellpadding="0" style="width: 825px">
          <tr>
            <td align="center" valign="middle" bgcolor="#669900" style="border-top:2px solid #FF9900; padding-left:20px; font-size:11px; font-family:Verdana, Arial, Helvetica, sans-serif;">ABASTOS Y FERRETERIA BATONGO <br />
PASACABALLOS Calle 15 #918<br />
              Cartagena<br />
			</td>
<!--
We request you retain the full web design copyright notice below including the link to http://www.sarkis-webdesign.com
This not only gives respect to the large amount of time given freely by the designer but also helps build interest, traffic and use of template. If you cannot (for good reason) retain the full design copyright we request you at least leave in place the image Web designer - Sarkis, with linked to http://www.sarkis-webdesign.com. Good luck!

Web designer Sarkis
// -->
                      </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
</table>
    <img id="bottom" src="<%=BASEURL%>/bottom.png" alt=""></img>
</body>
</html>


